<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class InitUpdate38 extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('yfs_activity', function (Blueprint $table) {
            $table->boolean('is_need_phone')->default(0)->comment('是否强制要求手机号'); 
            // $table->integer('source_type')->default(1)->index()->comment('来源 1为开盒获得  2为转售获得'); 
        });

        Schema::table('package_assets', function (Blueprint $table) {
            $table->integer('room_id')->nullable()->index()->comment('房间id、仅部分活动有，如一番赏'); 
            // $table->integer('source_type')->default(1)->index()->comment('来源 1为开盒获得  2为转售获得'); 
        });

        Schema::table('products', function (Blueprint $table) {
            $table->string('supplier', 100)->nullable()->comment('供应商名称'); 
        });

        Schema::table('order_skus', function (Blueprint $table) {
            $table->string('supplier', 100)->nullable()->comment('供应商名称'); 
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('yfs_activity', function (Blueprint $table) {

            $table->dropColumn(['is_need_phone']);
        });

        Schema::table('package_assets', function (Blueprint $table) {
            $table->dropColumn(['room_id']);
        });

        Schema::table('products', function (Blueprint $table) {
            $table->dropColumn(['supplier']);
        });

        Schema::table('order_skus', function (Blueprint $table) {
            $table->dropColumn(['supplier']);
        });
    }
}
